package com.kuaidu.ll.quickreadnews.base;

/**
 * Created by liulei on 2017/7/17.
 */
public abstract class MvpFragment<P extends BasePresenter> extends BaseFragment implements BaseView {
    public P presenter;

    public abstract P initPresenter();

    @Override
    protected void beforeLoadView() {
        super.beforeLoadView();
        presenter = initPresenter();
        presenter.addView(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        presenter.dettachView();
    }
}
